<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Reply extends Model {
    use HasFactory;
    protected $fillable = ['content'];

    public function topic(){
        return $this->belongsTo(Topic::class);
    }

    public function user(){
        return $this->belongsTo(User::class);
    }
    public function scopeRecent($query){
        return $query->orderBy('id','DESC');
    }
}
